#include <iostream>
#include <vector>
using namespace std;

int n, m;
vector<int> nums;

void dfs(int pos, int cur_total, int target, vector<int>& cur)
{
    if(cur_total == target)
    {
        for(auto& x : cur) cout << x << " ";
        cout << endl;
        return;
    }
    if(pos >= n || cur_total > target) return;
    for(int i = pos; i < n; i++)
    {
        cur.push_back(nums[i]);
        dfs(i + 1, cur_total + nums[i], target, cur);
        cur.pop_back();
    }
}

int main()
{
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
        nums.push_back(i);
    vector<int> cur;
    dfs(0, 0, m, cur); 
    return 0;
}